In computing, a pipeline is a set of data processing elements connected in series, so that the output of one element is the input of the next. A pipeline is divided into segments or stages, and each segment can execute its operation concurrently with the other segments. When a segment completes an operation, a result is passed to the next segment in the pipeline and fetches the next operation from the preceding segment. The final results of each instruction emerge at the end of the pipeline in rapid succession. Pipelining is also known as pipeline processing.
An everyday example of a pipeline is a factory assembly line. For example, if a car were being assembled using the stages of engine installation, hood installation, and wheel installation, The car would go through each stage in that order. First, the car would have its engine installed, then move on to the hood installation, letting a second car proceed with the engine installation. Then the first car would go to wheel installation, the second car to hood installation, and a third car would begin engine installation. Using this method, all three cars can be completed in less time than it would take if only one car were operated on at once.
Examples of computer-related pipelines include instruction pipelines, graphics pipelines, and software pipelines. Instruction pipelines are used in processors to allow two or more consecutive instructions from a nominally sequential stream to be executed in parallel. In this case, the segments of data processing elements in the pipeline are the logic circuits that implement the various stages of an instruction, such as address decoding and arithmetic, register fetching, and cache lookup. While instruction pipelines were once only used in high performance and RISC processors, such pipelines are now common in microprocessors used in personal computers.
Graphics pipelines are found in most graphics cards, which are made up of multiple arithmetic units or CPUs that implement the various stages of rendering operations. A graphics pipeline commonly reads in a representation of a 3D scene as input and outputs a 2D raster image at the end of the pipeline. Stages of the graphics pipeline include modeling transformation, lighting, viewing transformation, projection transformation, and rasterization. A 3D scene can be passed to a graphics pipeline as a set of vertices, which can be considered independent. This allows all stages of the pipeline to be used on different sets of vertices as they work their way through the stages. In addition, graphics processors may use parallel processing units to process multiple vertices in a single stage of the pipeline at the same time.
Software pipelines include multiple processes that are arranged so that the output stream of one process is fed as the input stream of the next one. A buffer is usually provided between consecutive elements so that one process can provide more data than the next is willing or able to receive. A typical example of a software pipeline is a Unix shell pipeline.